<?php
  //Bust cache in the head
  header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
  header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");

  //always modified
  header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
  header ("Pragma: no-cache"); // HTTP/1.0
?>
<?php echo(doctype('xhtml1-trans'))?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title><?php echo $Title;?></title>
	<link rel="icon" href="<?php echo image_asset_url('../css/images/favicon.ico');?>" type="image/x-icon" />
	<link rel="shortcut icon" href="<?php echo image_asset_url('../css/images/favicon.ico');?>" type="image/x-icon" />		
    <?php echo meta('title', $mTitle);?>
    <?php echo meta('description', $mDesc);?>
    <?php echo meta('keywords', $mKey);?>
    <?php echo meta('language', 'th');?>
    <?php echo meta('robots', 'index,follow');?>
    <?php echo(meta(array('name'=>'Content-type','content'=>'text/html;charset=UTF-8','type'=>'equiv')))?>
	<script type="text/javascript">
	 	/*Set Web Path*/
		var web_path = '<?php echo base_url();?>';	
	</script>	
	
    <!--Load Js-->
    <?php 
    if(!empty($js)):
            foreach($js as $value):
                    if(file_exists(realpath(@$this->config->item('path_asset_url').'assets/js/'.$value)) && !empty($value)):
                            echo js_asset($value)."\n";				
                    endif;
            endforeach;
    endif;
    ?>
    <!--Load Css-->
    <?php 
    if(!empty($css)):
            foreach($css as $value):
                    if(file_exists(realpath(@$this->config->item('path_asset_url').'assets/css/'.$value)) && !empty($value)):
                            echo css_asset($value,'', array('media'=>'all'))."\n";			
                    endif;
            endforeach;
    endif;
    ?>
    <!--Load External Js-->
    <?php
    if(!empty($external_js)):
	?>
	<script type="text/javascript" language="javascript">
    	<?php echo $external_js;?>
	</script>
	<?php
    endif;
    ?>
    <!--Load External Css-->
    <?php
    if(!empty($external_css)):
	?>
	<style type="text/css">
    	<?php echo $external_css;?>
	</style>
	<?php
    endif;
    ?>
</head>
<body>
	<!-- BODY -->
	<?php $this->load->view($content)?>
	<!-- END BODY -->
</body>
</html>